]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
global: Filter out destroyed actors from get_window_actors()
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 10 Sep 2014 20:41:40 +0000 (22:41 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 11 Sep 2014 15:51:31 +0000 (16:51 +0100)
All current code assumes that the list of window actors corresponds to the
list of windows; however as the list returned by meta_get_window_actors()
now includes actors during the destroy animation, that assumption breaks.

Eventually we should make everyone move to a more appropriate API, but
for now make it work again by returning a filtered list of "good"
window actors.

https://bugzilla.gnome.org/show_bug.cgi?id=735927

src/shell-global.c

index 1e655305de5b82564e50b0e24fac0c0c1a8861f6..d90ceaff888bafe8906f8c79a1adf539a55b7ef3 100644 (file)
@@ -735,14 +735,21 @@ shell_global_get_display (ShellGlobal  *global)
  *
  * Gets the list of #MetaWindowActor for the plugin's screen
  *
- * Return value: (element-type Meta.WindowActor) (transfer none): the list of windows
+ * Return value: (element-type Meta.WindowActor) (transfer container): the list of windows
  */
 GList *
 shell_global_get_window_actors (ShellGlobal *global)
 {
+  GList *filtered = NULL;
+  GList *l;
+
   g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL);
 
-  return meta_get_window_actors (global->meta_screen);
+  for (l = meta_get_window_actors (global->meta_screen); l; l = l->next)
+    if (!meta_window_actor_is_destroyed (l->data))
+      filtered = g_list_prepend (filtered, l->data);
+
+  return g_list_reverse (filtered);
 }
 
 static void